package com.ling.feign.plus.context;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;

public class FeignEnvironmentAware implements EnvironmentAware {
    private static Environment ENV;

    @Override
    public void setEnvironment(Environment environment) {
        ENV = environment;
    }

    public static String getApplicationName() {
        return ENV == null ? "unknownServer" : ENV.getProperty("spring.application.name");
    }
}

